package com.hksj.em.controller;

import com.hksj.common.core.model.Rest;
import com.hksj.em.dto.create.CreateIntelligentDispatchingDTO;
import com.hksj.em.query.IntelligentDispatchingQuery;
import com.hksj.em.service.IntelligentDispatchingService;
import com.hksj.em.vo.IntelligentDispatchingVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@Api(tags = "智慧手术室-智能调度")
@RestController
@RequestMapping("/api/intelligentDispatching")
public class IntelligentDispatchingController {

    @Autowired
    private IntelligentDispatchingService service;

    @ApiOperation(value = "查询智能调度列表")
    @PostMapping("/queryIntelligentDispatchingRecord")
    public Rest<List<IntelligentDispatchingVO>> queryIntelligentDispatchingRecord(@RequestBody IntelligentDispatchingQuery query) {
        List<IntelligentDispatchingVO> list = service.queryIntelligentDispatchingRecord(query);
        return Rest.ok(list);
    }

    @ApiOperation(value = "智能调度维护")
    @PostMapping("/insertOrUpdateById")
    public Rest insertOrUpdateById(@RequestBody CreateIntelligentDispatchingDTO dto) {
        return service.insertOrUpdateById(dto);
    }
}
